<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="telephone=no" name="format-detection">
<meta http-equiv="x-rim-auto-match" content="none">
<title>{lang(onlinepayment)}</title>
<meta name="keywords" content="{getKeywords($archive,$category,$catid,$type)}" />
<meta name="description" content="{getDescription($archive,$category,$catid,$type)}" />
<meta name="author" content="CmsEasy Team" />
<link rel="icon" href="{get(site_ico)}" type="image/x-icon" />
<link rel="stylesheet" href="{$skin_path}/css/orders.css" />
<meta name="author" content="CmsEasy Team" />
<link rel="icon" href="{get(site_ico)}" type="image/x-icon" />
<script type="text/javascript" src="{$skin_path}/js/jquery-1.8.3.min.js"></script>
</head>
<body>



<div class="t_1">
<div>
<h3><a href="{$cat['url']}" title="{$cat['catname']}">{lang(onlinepayment)}</a></h3>
<p>Online Payment</p>
</div>
</div>

<!-- 中部开始 -->
<div class="o_box">
<script type="text/javascript">

function check(){

if(document.orders.pnums.value.length==0){
   alert("{lang(enter)}{lang(ordercontactname)}!");
   document.orders.pnums.focus();
   return false;
}

if(document.orders.pname.value.length==0){
   alert("{lang(enter)}{lang(ordercontactname)}!");
   document.orders.pname.focus();
   return false;
}

if(document.orders.telphone.value.length==0){
   alert("{lang(enter)}{lang(ordertel)}!");
   document.orders.telphone.focus();
   return false;
}
{if config::get('mobilechk_enable') && config::get('mobilechk_buy')}
		if($('#mobilenum').val() == ''){
			alert("{lang(please_enter_the_phone_verification_code)}");	
			$('#mobilenum').focus();
			return false;
		}
		{/if}

if(document.orders.address.value.length==0){
   alert("{lang(enter)}{lang(orderaddress)}!");
   document.orders.address.focus();
   return false;
}

if(document.orders.postcode.value.length==0){
   alert("{lang(enter)}{lang(email)}!");
   document.orders.postcode.focus();
   return false;
}


if(document.orders.pnums.value.length==0){
   alert("{lang(enter)}{lang(ordercontactname)}!");
   document.orders.pnums.focus();
   return false;
}

return true; 
} 


function setTotal(){ 
var s=0; 


$("#table tr td table").each(function(){ 
s+=parseInt($(this).find('input[class*=text_box]').val())*parseFloat($(this).find('span[class*=price]').text()); 
}); 

$("#tab").each(function(){ 
s+=parseInt($(this).find('input[class*=text_box]').val())*parseFloat($(this).find('span[class*=price]').text()); 
}); 

$("#total").html(s.toFixed(2)); 
} 

//加减

$(function(){ 
$(".add").click(function(){ 
var t=$(this).parent().find('input[class*=text_box]'); 
t.val(parseInt(t.val())+1) 
setTotal(); 
}) 
$(".min").click(function(){ 
var t=$(this).parent().find('input[class*=text_box]'); 
t.val(parseInt(t.val())-1) 
if(parseInt(t.val())<0){ 
t.val(0); 
} 
setTotal(); 
}) 

setTotal(); 

}) 

</script>


<form action="{uri()}" id="orders" name="orders" method="post" onsubmit="return check()">


    {if $orderaidlist}

       <table width="100%" border="0" align="center" cellpadding="8" cellspacing="0"  class="o_list" id="table">
        <tr class="th">
          <th align="left" style="padding-left:30px;">{lang(productname)}</th>
          <th class="s_none" width="100">{lang(productprice)}</th>
          <th width="180">{lang(pordernums)}</th>
         
          <th style="background-image:none;" width="60">{lang(dosomething)}</th>
        </tr>
        {loop $orderaidlist $val}
        <input type="hidden" name="aid[]" value="{$val['aid']}" />
        <tr id="list{$val['aid']}">
          <td align="left" width="620">
 		  <a target="_blank" href="{$base_url}/index.php?case=archive&act=show&aid={$val[aid]}" class="o_img_box"><img src="{$val[thumb]}" onerror='this.src="{config::get('onerror_pic')}"' /></a><a target="_blank" href="{$base_url}/index.php?case=archive&act=show&aid={$val[aid]}" class="o_title">{$val[title]}</a>
		  </td>
		  <td colspan="2" align="center"><table><tr style="border:none;">
          <td align="center" width="100">{lang(the_symbol_of_money)}&nbsp;<span id="thisprice{$val[aid]}" align="center" class="price">{$val[attr2]}</span>&nbsp;{lang(unit)}</td>
          <td align="center" width="180">
		  <input class="min" name="" type="button" value="-" /> 
<input class="text_box" type="text" id="thisnum{$val[aid]}" name="thisnum[{$val[aid]}]" value="{$val[amount]}" size="5"  onchange="changetotalprdersprice1('thistotal{$val[aid]}','thisprice{$val[aid]}','thisnum{$val[aid]}')"  />
<input class="add" name="" type="button" value="+" /> 
</td>
</tr>
</table>
</td>


          <td align="center" width="60">
		  <a href="#" onclick="document.getElementById('list{$val['aid']}').style.display='none';document.getElementById('thisnum{$val[aid]}').value=0;setTotal();"  title="{lang(delete)}" class="o_del">&Chi;</a>
		  </td>
        </tr>
        {/loop}
		
      </table>

    {else}
	<div id="tab">
	<table width="100%" border="0" align="center" cellpadding="8" cellspacing="0"  class="o_list">
        <tr class="th">
          <th align="left" style="padding-left:30px;">{lang(productname)}</th>
          <th class="s_none">{lang(productprice)}</th>
          <th>{lang(pordernums)}</th>
        </tr>
      <tr> 
        <td align="left" width="580">
 		  <a target="_blank" href="{$archive[url]}" class="o_img_box"><img src="{$archive[thumb]}" onerror='this.src="{config::get('onerror_pic')}"' /></a><a target="_blank" href="{$archive[url]}" class="o_title">{$archive[title]}</a>
		  </td>
          <td align="center">{lang(the_symbol_of_money)}&nbsp;<span id="thisprice" align="center" class="price">{$archive[attr2]}</span>&nbsp;{lang(unit)}</td>
          <td align="center">
		 <input class="min" name="" type="button" value="-" /> 
<input class="text_box" type="text" size="5" maxlength="10" name="pnums" id="pnums" value="1" onchange="changetotalprdersprice()" />
<input class="add" name="" type="button" value="+" /> 
</td>
        
      </tr> 

        </table>
		</div>
     {/if}
     
<div class="blank30"></div>

<div class="thistotal">

{lang(ordertotal)}：{lang(the_symbol_of_money)}<label id="total"></label>

</div> 


<div class="blank30"></div>
<a href="#lianxi" class="lianxi fr">{lang('fill_in_the_contact_form_to_complete_the_shopping')}</a>
<div style="clear:both;height:600px;"></div>
</div> 



<div class="t_1" id="lianxi">
<div>
<h3><a href="{$cat['url']}" title="{$cat['catname']}">{lang(contactmode)}</a></h3>
<p>Contact information</p>
</div>
</div>
<div class="o_box">
<table width="100%" border="0" align="left" cellpadding="8" cellspacing="0" class="o_list_2">

      <tr> 
        <td class="td_l" align="right" width="210">{lang(ordercontactname)}：</td> 
        <td class="td_r" align="left"><input type="text" name="pname" /><br />
          <font color="green">{lang(pcontactnametips)}</font></td> 
      </tr> 

	  <tr> 
        <td class="td_l" align="right">{lang(ordertel)}：</td> 
        <td class="td_r" align="left"><input type="text" id="telphone" name="telphone" /><br />
          <font color="green">{lang(pcontactteltips)}</font></td> 
      </tr> 
      {if config::get('mobilechk_enable') && config::get('mobilechk_buy')}
	  <script src="{$base_url}/js/mobilechk.js"></script>
<tr> 
        <td class="td_l" align="right">{lang(mobile)}：</td> 
        <td class="td_r" align="left"><input placeholder="{lang(p_m_content)}" type='text' id="tel"  name="tel" value="" tabindex="3" class="input" /><br />
          <font color="green">{lang(pcontactteltips)}</font></td> 
      </tr> 

	  
      <tr> 
        <td class="td_l" align="right">{lang('mobile_phone_checksum')}：</td> 
        <td class="td_r" align="left"><input type='text' id="mobilenum"  tabindex="4" placeholder="{lang('please_enter_the_phone_verification_code')}" class="input" style="width:40%"  name="mobilenum" /> <input id="btm_sendMobileCode" onclick="sendMobileCode('{url('tool/smscode')}',$('#telphone'));" type="button" value="{lang(send_cell_phone_verification_code)}" /></td>
	</tr> 
{/if}

      <tr> 
        <td class="td_l" align="right">{lang(orderaddress)}：</td> 
        <td class="td_r" align="left"><input type="text" name="address"/></td> 
      </tr> 
      <tr> 
        <td class="td_l" align="right">{lang(email)}：</td> 
        <td class="td_r" align="left"><input type="text" name="postcode"/></td> 
      </tr> 
      
      {if $logisticslist}
      <tr> 
        <td class="td_l" align="right">{lang(pickingmethods)}：</td> 
        <td class="td_r" align="left">
        {loop $logisticslist $logistics}
        
        <input name="logisticsid" type="radio" value="{$logistics[id]}" checked="checked" /><strong>{$logistics[title]}</strong> {lang(fees)}：{$logistics[price]}<br />
        {$logistics[content]}

        {/loop}
        </td> 
      </tr>
      {/if} 
      
     
      <tr> 
        <td class="td_l" align="right">{lang(payment)}：</td>
        
        <td class="td_r" align="left">
        {if $paylist}
        {loop $paylist $pay}
        {if $pay[enabled]==1} 
    
        <input name="payname" type="radio" value="{$pay[pay_code]}" checked="checked" /><strong>{$pay[pay_name]}</strong>&nbsp;{lang(rates)}：{$pay[pay_fee]}%
        <!-- {$pay[pay_desc]} -->
       
        {/if}
        {/loop}
        
        {else}
        {lang(nopayment)}   
        {/if}     
        </td> 
        
      </tr> 
      
      
      <tr> 
        <td class="td_l" align="right">{lang(ordercontent)}：</td> 
        <td align="left" align="left" valign="top"><textarea name="content"  style="margin-left:16px;" ></textarea> 
         </td> 
      </tr> 
 
      
    </table> 

	<div class="blank30"></div>
        <div style="margin-left:1px;">
		<input type="submit" name="submit" value=" {lang(submit_on)} " class="o_btn" />
        <input type="reset" value=" {lang(reset)} " class="o_btn2" />
		
       </div>
</form>

<div class="blank30"></div>
<div class="blank30"></div>
<div class="blank30"></div>
<div class="copy">
{get(site_right)} <a title="{get('sitename')}" href="{$base_url}/">{get('sitename')}</a> All Rights Reserved.      {getCopyRight()}
</div>

</body>
</html>